package cc.rengu.redp.bizimpl.csmc.service.impl;

import cc.rengu.redp.bizimpl.csmc.domain.CTxncdConv;
import cc.rengu.redp.bizimpl.csmc.dao.CTxncdConvMapper;
import cc.rengu.redp.bizimpl.csmc.service.ICTxncdConvService;
import cc.rengu.redp.bizimpl.utils.CommonUtils;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author lizk
 */
@Service
@DS("csmc")
public class CTxncdConvServiceImpl extends ServiceImpl<CTxncdConvMapper, CTxncdConv> implements ICTxncdConvService {

    @Override
    public List<CTxncdConv> findAllTxnNUm() {
        List<CTxncdConv> list = this.list();
        list = list.stream().filter(CommonUtils.distinctByKey(b -> b.getTxnNum())).collect(Collectors.toList());
        list = list.stream().filter(CommonUtils.distinctByKey(b -> b.getTxnDesc())).collect(Collectors.toList());
        return list;
    }
}
